<#escape x as x?html>
<div class="box box-solid box-fusion no-shadow no-border">
    <div class="box-body">
        <div class="row">
            <div class="col-md-5">
                <div class="list-tree fancytree-default"></div>
                <div class="btn-group no-padding">
                    <button class="btn btn-default btn-sm action-insert">
                        <i class="fa fa-plus"> <@s.message "page.insert"/></i>
                    </button>
                    <button class="btn btn-default btn-sm action-update">
                        <i class="fa fa-save"> <@s.message "page.update"/></i>
                    </button>
                    <button class="btn btn-default btn-sm action-delete">
                        <i class="fa fa-trash-o"> <@s.message "page.delete"/></i>
                    </button>
                </div>
            </div>
            <div class="col-md-7">
                <form class="form" name="recordForm" id="recordForm" method="post" action="${actionType!}">
                    <input type="text" class="hidden"
                           name="id" value="${(record.id)!}">
                    <div class="form-group">
                        <label class="control-label" for="code"><@s.message "base.permission.modal.code"/></label>
                        <input type="text" class="form-control"
                               name="code" placeholder="<@s.message "base.permission.modal.code"/>"
                               data-error="<@s.message "validator.error.require"/>" required
                               value="${(record.code)!}">
                        <div class="help-block with-errors"></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="name"><@s.message "base.permission.modal.name"/></label>
                        <input type="text" class="form-control"
                               name="name" placeholder="<@s.message "base.permission.modal.name"/>"
                               data-error="<@s.message "validator.error.require"/>" required
                               value="${(record.name)!}">
                        <div class="help-block with-errors"></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label"
                               for="pageUrl"><@s.message "base.permission.modal.pageUrl"/></label>
                        <input type="text" class="form-control"
                               name="pageUrl" placeholder="<@s.message "base.permission.modal.pageUrl"/>"
                               value="${(record.pageurl)!}">
                    </div>
                    <div class="form-group">
                        <label class="control-label"
                               for="pid"><@s.message "base.permission.modal.parentCode"/></label>
                        <input type="text" class="hide"
                               name="parentCode" placeholder="<@s.message "base.permission.modal.parentCode"/>">
                        <input type="text" class="form-control form-control input-sm pull-right parent-tree"
                               style="cursor: pointer"
                               name="parentName"/>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="type"><@s.message "base.permission.modal.type"/></label>
                        <select class="form-control" data-dict="permission_type" data-value="${(record.type)!}"
                                name="type">
                        </select>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="iconCss"><@s.message "base.permission.modal.icon"/></label>
                        <input type="text" class="form-control"
                               name="iconCss" placeholder="<@s.message "base.permission.modal.icon"/>"
                               value="${(record.iconCss)!}">
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="sort"><@s.message "base.permission.modal.sort"/></label>
                        <input type="text" class="form-control"
                               name="sort" placeholder="<@s.message "base.permission.modal.sort"/>"
                               value="${(record.sort)!}">
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="state"><@s.message "base.permission.modal.state"/></label>
                        <select class="form-control" data-dict="state" data-value="${(record.state)!}"
                                name="state">
                        </select>
                    </div>
                    <div class="form-group">
                        <label class="control-label"
                               for="description"><@s.message "base.permission.modal.description"/></label>
                        <input type="text" class="form-control"
                               name="description" placeholder="<@s.message "base.permission.modal.description"/>"
                               value="${(record.description)!}">
                    </div>
                </form>
            </div>
        </div>
    </div><!-- /.box-body-->
</div>
    <@y.htmlModal/>
</body>
<script>
    context.call([
        "${modulesPath}/common/js/permission.js",
        "scanSelect"
    ], function (p, scanSelect) {
        var treeUrl = "/base/permission/rest/tree";
        p.initPermissionPage(treeUrl, "/base/permission");
        scanSelect.initSelect();
    })
</script>
</#escape>
